FROM centos:6

MAINTANIER hsyh.tong@gmail.com

RUN yum -y install --nogpgcheck epel-release && \
    yum -y install --nogpgcheck http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm && \
    yum makecache && \
    yum -y -q install --nogpgcheck zabbix zabbix-server-mysql net-snmp-devel net-snmp-libs net-snmp net-snmp-perl net-snmp-python net-snmp-utils libcurl libxml2 iksemel libssh2 && \
    yum clean all 

# Zabbix Conf Files
ADD ./zabbix/zabbix_server.conf    /etc/zabbix/zabbix_server.conf
RUN chmod 640 /etc/zabbix/zabbix_server.conf
RUN chown root:zabbix /etc/zabbix/zabbix_server.conf

# Enable networking
RUN echo "NETWORKING=yes" > /etc/sysconfig/network

# Expose the Zabbix Server port 10051  
EXPOSE 10051 

# Start the custom zabbix_server binary in foreground mode ( -f )
CMD ["/usr/sbin/zabbix_server"," -c", "/etc/zabbix/zabbix_server.conf"]